﻿<%@ Page Language="C#" AutoEventWireup="true" Inherits="Pages_CallList" Codebehind="CallRouteList.aspx.cs" MasterPageFile="~/Pages/Master/MainAdmin.Master" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="server">
        <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

        <script src="../../JavaScript/FieldFormatters.js" type="text/javascript"></script>

        <fieldset id="pageLoad">
        <div id="fillInData">
           <h1>Chamados</h1>
           <fieldset id="filter">
           <legend>Filtrar por</legend>
           <div class="fillInDataField">
                <div class="label">
                    <label for="txbId">ID</label>
                </div>
                <asp:TextBox ID="txbId" runat="server" CssClass="component tiny"></asp:TextBox>
           </div>

           <div class="fillInDataField">
                <div class="label">
                    <label for="txbDataOpening">Data de Abertura</label>
                </div>
                <asp:TextBox ID="txbDataOpening" runat="server" CssClass="component small" OnKeyUp="formatDate(this, event); "></asp:TextBox>
           </div>

           <div class="fillInDataField">
                <div class="label">
                    <label for="txbProblemDescription">Descrição do Problema</label>
                </div>
                <asp:TextBox ID="txbProblemDescription" runat="server" Width="239px" 
                    CssClass="component big"></asp:TextBox>
           </div>

           <div class="fillInDataField">
                <div class="label">
                    <label for="ddlStatus">Status</label>
                </div>
                <asp:DropDownList ID="ddlStatus" runat="server" CssClass="component medium"></asp:DropDownList>
            </div>

           <div class="fillInDataField">
                <div class="label">
                    <label for="ddlCallCategory">Categoria</label>
                </div>
                    <asp:DropDownList ID="ddlCallCategory" runat="server" AutoPostBack="True" 
                        onselectedindexchanged="ddlCallCategory_SelectedIndexChanged" 
                    CssClass="component medium">
                    </asp:DropDownList>
            </div>

            <div class="fillInDataField">
                <div class="label">
                    <label for="ddlCallSubCategory">Subcategoria</label>
                </div>
                <asp:DropDownList ID="ddlCallSubCategory" runat="server" 
                    CssClass="component medium"> </asp:DropDownList>
            <asp:Button ID="btnSearch" runat="server" onclick="btnSearch_Click" 
                Text="Pesquisar" CssClass="button find" />

            </div>
            </fieldset>
            
            <div class="fillInDataField">
                <asp:GridView ID="gdvCall" runat="server" AutoGenerateColumns="False" 
            DataSourceID="odsCall" onrowcommand="gdvCall_RowCommand" CellPadding="4" 
                    Font-Size="X-Small" ForeColor="#333333" GridLines="None" AllowPaging="True" 
                    Font-Names="Courier New" Width="100%">
                    <AlternatingRowStyle BackColor="White" />
            <Columns>
                <asp:BoundField DataField="Id" HeaderText="ID" SortExpression="Id" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Left" Width="5%" />
                </asp:BoundField>
                <asp:BoundField DataField="DateOpening" HeaderText="Data de Abertura" 
                    SortExpression="DateOpening" DataFormatString="{0:dd/MM/yyyy}" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="7.5%" />
                </asp:BoundField>
                <asp:BoundField DataField="DateClosing" HeaderText="Data de Encerramento" 
                    SortExpression="DateClosing" DataFormatString="{0:dd/MM/yyyy}" >
                <HeaderStyle HorizontalAlign="Center" />
                <ItemStyle HorizontalAlign="Center" Width="7.5%" />
                </asp:BoundField>
                <asp:TemplateField HeaderText="Categoria" SortExpression="CallSubCategory">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("CallSubCategory") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label1" runat="server" Text='<%# Bind("CallSubCategory.CallCategory.Description") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Subcategoria" SortExpression="CallSubCategory">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("CallSubCategory") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label2" runat="server" Text='<%# Bind("CallSubCategory.Description") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Atendente" SortExpression="UserFinish">
                    <ItemTemplate>
                        <asp:Label ID="Label3" runat="server" Text='<%# Eval("UserFinish.Name") %>'></asp:Label>
                    </ItemTemplate>
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox3" runat="server" Text='<%# Bind("UserFinish") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Left" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Unidade" SortExpression="Sector">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox4" runat="server" Text='<%# Bind("Sector.Unit") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label4" runat="server" Text='<%# Bind("Sector.Unit.Name") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Setor" SortExpression="Sector">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox5" runat="server" Text='<%# Bind("Sector") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label5" runat="server" Text='<%# Bind("Sector.Description") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Status" SortExpression="CallStatus">
                    <EditItemTemplate>
                        <asp:TextBox ID="TextBox6" runat="server" Text='<%# Bind("CallStatus") %>'></asp:TextBox>
                    </EditItemTemplate>
                    <ItemTemplate>
                        <asp:Label ID="Label6" runat="server" Text='<%# Bind("CallStatus.Description") %>'></asp:Label>
                    </ItemTemplate>
                    <HeaderStyle HorizontalAlign="Center" />
                    <ItemStyle HorizontalAlign="Center" Width="10%" />
                </asp:TemplateField>
                <asp:TemplateField> 
                    <ItemTemplate>
                        <asp:LinkButton runat= "server"  ID="lbUpdate" CommandArgument='<%# Bind("ID") %>' CommandName="Update" > <img src="../../Images/Icon/GOBACK_16x16.png" alt="Voltar"/> </asp:LinkButton>
                    </ItemTemplate>
                    <ItemStyle HorizontalAlign="Center" />
                </asp:TemplateField>
            </Columns>
                    <EditRowStyle BackColor="#2461BF" />
                    <FooterStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <HeaderStyle BackColor="#507CD1" Font-Bold="True" ForeColor="White" />
                    <PagerStyle BackColor="#2461BF" ForeColor="White" HorizontalAlign="Center" />
                    <RowStyle BackColor="#EFF3FB" />
                    <SelectedRowStyle BackColor="#D1DDF1" Font-Bold="True" ForeColor="#333333" />
                    <SortedAscendingCellStyle BackColor="#F5F7FB" />
                    <SortedAscendingHeaderStyle BackColor="#6D95E1" />
                    <SortedDescendingCellStyle BackColor="#E9EBEF" />
                    <SortedDescendingHeaderStyle BackColor="#4870BE" />
        </asp:GridView>

        <asp:ObjectDataSource ID="odsCall" runat="server" SelectMethod="GetOpenCalls" 
            TypeName="br.com.SistemaChamados.Controller.CallController">
        </asp:ObjectDataSource>
            </div>
        </div>
        </fieldset>
</asp:Content>